package cn.exrick.xboot.base.entity

import cn.exrick.xboot.core.base.XbootBaseEntityKt
import cn.exrick.xboot.core.common.utils.SnowFlakeUtil
import com.baomidou.mybatisplus.annotation.TableId
import com.baomidou.mybatisplus.annotation.TableName
import io.swagger.annotations.ApiModel
import io.swagger.annotations.ApiModelProperty
import org.hibernate.annotations.DynamicInsert
import org.hibernate.annotations.DynamicUpdate
import javax.persistence.Column
import javax.persistence.Entity
import javax.persistence.Id
import javax.persistence.Table

/**
 * @author Fei
 */
@Entity
@DynamicInsert
@DynamicUpdate
@Table(name = "en_safe_score_record")
@TableName("en_safe_score_record")
@ApiModel(value = "安全得分记录")
data class SafeScoreRecord(

        @ApiModelProperty("企业id")
        var enterpriseId: String? = null,

        @ApiModelProperty("员工id")
        var employeeId: String? = null,

        @ApiModelProperty("描述")
        var ScoreDesc: String? = null,

        @ApiModelProperty("分数")
        var score: Int? = 0,

        @ApiModelProperty("加0减1")
        var addOrSub: Int? = null,

        @ApiModelProperty("详情")
        @Column(length = 1000)
        var scoreDetail: String? = null

) : XbootBaseEntityKt() {

    @Id
    @TableId
    override var id: String = SnowFlakeUtil.nextId().toString()

    companion object {
        private const val serialVersionUID = 1L
    }
}